<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图书管理系统</title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background: #f5f5f5;
            overflow-x: hidden;
        }

        /* 顶部导航栏 */
        .top-header {
            background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
        }

        .logo {
            color: white;
            font-size: 20px;
            font-weight: bold;
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: #3498db;
        }

        .header-controls {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .header-btn {
            background: rgba(255,255,255,0.1);
            border: none;
            color: white;
            padding: 8px 12px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .header-btn:hover {
            background: rgba(255,255,255,0.2);
        }

        .user-info {
            display: flex;
            align-items: center;
            color: white;
            gap: 10px;
        }

        .user-details {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 2px;
        }

        .user-name {
            font-weight: 600;
            font-size: 14px;
        }

        .user-role {
            font-size: 12px;
            opacity: 0.8;
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #3498db;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
        }

        /* 侧边栏 */
        .sidebar {
            position: fixed;
            left: 0;
            top: 60px;
            width: 250px;
            height: calc(100vh - 60px);
            background: #2c3e50;
            overflow-y: auto;
            transition: all 0.3s ease;
            z-index: 999;
        }

        .sidebar::-webkit-scrollbar {
            width: 6px;
        }

        .sidebar::-webkit-scrollbar-track {
            background: #34495e;
        }

        .sidebar::-webkit-scrollbar-thumb {
            background: #7f8c8d;
            border-radius: 3px;
        }

        .nav-menu {
            padding: 20px 0;
        }

        .nav-item {
            margin-bottom: 5px;
        }

        .nav-link {
            display: flex;
            align-items: center;
            padding: 12px 25px;
            color: #bdc3c7;
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .nav-link:hover {
            background: #34495e;
            color: white;
            border-left-color: #3498db;
        }

        .nav-link.active {
            background: #34495e;
            color: white;
            border-left-color: #3498db;
        }

        .nav-link i {
            width: 20px;
            margin-right: 12px;
            text-align: center;
        }

        .nav-link .arrow {
            margin-left: auto;
            transition: transform 0.3s ease;
        }

        .nav-link.expanded .arrow {
            transform: rotate(90deg);
        }

        .sub-menu {
            background: #34495e;
            overflow: hidden;
            max-height: 0;
            transition: max-height 0.3s ease;
        }

        .sub-menu.expanded {
            max-height: 200px;
        }

        .sub-item {
            padding-left: 57px;
        }

        .sub-link {
            display: flex;
            align-items: center;
            padding: 10px 25px;
            color: #95a5a6;
            text-decoration: none;
            transition: all 0.3s ease;
            font-size: 14px;
        }

        .sub-link:hover {
            background: #2c3e50;
            color: white;
        }

        .sub-link.active {
            background: #2c3e50;
            color: #3498db;
        }

        .sub-link i {
            width: 16px;
            margin-right: 10px;
            text-align: center;
        }

        /* 主内容区 */
        .main-content {
            margin-left: 250px;
            margin-top: 60px;
            padding: 20px;
            min-height: calc(100vh - 60px);
            background: white;
            border-radius: 10px 0 0 0;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
            width: calc(100vw - 250px);
            box-sizing: border-box;
        }

        /* 表格容器样式 */
        .module-body {
            padding: 20px;
            width: 100%;
            box-sizing: border-box;
        }

        /* 确保表格填充满容器 */
        .layui-table-view {
            width: 100% !important;
        }

        .layui-table {
            width: 100% !important;
        }

        /* 优化弹窗样式 */
        .layui-layer {
            border-radius: 12px !important;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
        }

        .layui-layer-title {
            border-radius: 12px 12px 0 0 !important;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
            color: white !important;
            font-weight: 600 !important;
            padding: 15px 20px !important;
        }

        .layui-layer-content {
            border-radius: 0 0 12px 12px !important;
        }

        /* 优化表单样式 */
        .layui-form-label {
            width: 100px !important;
            font-weight: 500 !important;
        }

        .layui-input-block {
            margin-left: 130px !important;
        }

        .layui-input, .layui-textarea, .layui-select {
            border-radius: 8px !important;
            border: 2px solid #e6e6e6 !important;
            transition: all 0.3s ease !important;
        }

        .layui-input:focus, .layui-textarea:focus, .layui-select:focus {
            border-color: #667eea !important;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
        }

        /* 优化按钮样式 */
        .layui-btn {
            border-radius: 8px !important;
            font-weight: 500 !important;
            transition: all 0.3s ease !important;
        }

        .layui-btn:hover {
            transform: translateY(-2px) !important;
            box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
        }

        /* 优化侧边栏样式 */
        .sidebar {
            border-radius: 0 20px 20px 0 !important;
            box-shadow: 5px 0 20px rgba(0,0,0,0.1) !important;
        }

        .nav-link {
            border-radius: 12px !important;
            margin: 5px 10px !important;
            transition: all 0.3s ease !important;
        }

        .nav-link:hover {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
            transform: translateX(5px) !important;
        }

        .nav-link.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3) !important;
        }

        .sub-menu {
            border-radius: 12px !important;
            margin: 5px 10px !important;
        }

        .sub-link {
            border-radius: 8px !important;
            margin: 2px 5px !important;
            transition: all 0.3s ease !important;
        }

        .sub-link:hover {
            background: rgba(102, 126, 234, 0.1) !important;
            transform: translateX(3px) !important;
        }

        .sub-link.active {
            background: rgba(102, 126, 234, 0.2) !important;
            color: #667eea !important;
        }

        .page-header {
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 2px solid #ecf0f1;
        }

        .page-title {
            font-size: 28px;
            color: #2c3e50;
            font-weight: 600;
            margin-bottom: 10px;
        }

        .page-subtitle {
            color: #7f8c8d;
            font-size: 16px;
        }

        /* 模块内容样式 */
        .module-content {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            overflow: hidden;
        }

        .module-header {
            background: #f8f9fa;
            padding: 20px;
            border-bottom: 1px solid #e9ecef;
        }

        .module-title {
            font-size: 18px;
            color: #2c3e50;
            font-weight: 600;
            margin-bottom: 5px;
        }

        .module-description {
            color: #6c757d;
            font-size: 14px;
        }

        .module-body {
            padding: 20px;
        }

        /* 搜索表单样式 */
        .search-form {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 20px;
            border: 1px solid #e9ecef;
        }

        .form-row {
            display: flex;
            gap: 15px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .form-group {
            flex: 1;
            min-width: 200px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #495057;
            font-weight: 500;
        }

        .form-control {
            width: 100%;
            padding: 10px 15px;
            border: 1px solid #ced4da;
            border-radius: 6px;
            font-size: 14px;
            transition: border-color 0.3s ease;
        }

        .form-control:focus {
            outline: none;
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
        }

        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .btn-primary {
            background: #3498db;
            color: white;
        }

        .btn-primary:hover {
            background: #2980b9;
            transform: translateY(-1px);
        }

        .btn-secondary {
            background: #6c757d;
            color: white;
        }

        .btn-secondary:hover {
            background: #5a6268;
        }

        .btn-success {
            background: #28a745;
            color: white;
        }

        .btn-success:hover {
            background: #218838;
        }

        .btn-warning {
            background: #ffc107;
            color: #212529;
        }

        .btn-warning:hover {
            background: #e0a800;
        }

        .btn-danger {
            background: #dc3545;
            color: white;
        }

        .btn-danger:hover {
            background: #c82333;
        }

        /* 表格样式优化 */
        .layui-table {
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .layui-table thead tr {
            background: #f8f9fa;
        }

        .layui-table th {
            background: #f8f9fa;
            color: #495057;
            font-weight: 600;
            border-bottom: 2px solid #dee2e6;
        }

        .layui-table td {
            border-bottom: 1px solid #f1f3f4;
        }

        .layui-table tbody tr:hover {
            background: #f8f9fa;
        }

        /* 统计卡片样式 */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: white;
            padding: 25px;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            border-left: 4px solid #3498db;
            transition: transform 0.3s ease;
        }

        .stat-card:hover {
            transform: translateY(-5px);
        }

        .stat-card.book {
            border-left-color: #e74c3c;
        }

        .stat-card.user {
            border-left-color: #f39c12;
        }

        .stat-card.borrow {
            border-left-color: #27ae60;
        }

        .stat-card.overdue {
            border-left-color: #9b59b6;
        }

        .stat-icon {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: white;
            margin-bottom: 15px;
        }

        .stat-card.book .stat-icon {
            background: #e74c3c;
        }

        .stat-card.user .stat-icon {
            background: #f39c12;
        }

        .stat-card.borrow .stat-icon {
            background: #27ae60;
        }

        .stat-card.overdue .stat-icon {
            background: #9b59b6;
        }

        .stat-number {
            font-size: 32px;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .stat-label {
            color: #7f8c8d;
            font-size: 14px;
        }

        /* 页脚 */
        .footer {
            text-align: center;
            padding: 20px;
            color: #7f8c8d;
            font-size: 14px;
            border-top: 1px solid #ecf0f1;
            margin-top: 40px;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
            }
            
            .main-content {
                margin-left: 0;
            }
            
            .form-row {
                flex-direction: column;
            }
            
            .stats-grid {
                grid-template-columns: 1fr;
            }
        }

        /* 动画效果 */
        .fade-in {
            animation: fadeIn 0.5s ease-in;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 工具提示样式 */
        .tooltip {
            position: relative;
            cursor: help;
        }

        .tooltip:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: #2c3e50;
            color: white;
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 12px;
            white-space: nowrap;
            z-index: 1000;
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <div class="top-header">
        <div class="logo">
            <i class="fas fa-book"></i>
            图书管理系统
        </div>
        <div class="header-controls">
            <button class="header-btn" title="刷新">
                <i class="fas fa-sync-alt"></i>
            </button>
            <button class="header-btn" title="全屏">
                <i class="fas fa-expand"></i>
            </button>
            <button class="header-btn" title="设置">
                <i class="fas fa-cog"></i>
            </button>
            <div class="user-info">
                <div class="user-avatar">
                    <i class="fas fa-user"></i>
                </div>
                <div class="user-details">
                    <span class="user-name">用户</span>
                    <span class="user-role">角色</span>
                </div>
                <button class="header-btn" id="logoutBtn" title="退出登录">
                    <i class="fas fa-sign-out-alt"></i>
                </button>
            </div>
        </div>
    </div>

    <!-- 侧边栏 -->
    <div class="sidebar">
        <div class="nav-menu">
            <div class="nav-item">
                <a href="#" class="nav-link active" data-module="dashboard">
                    <i class="fas fa-home"></i>
                    系统概览
                </a>
            </div>
            
            <div class="nav-item">
                <a href="#" class="nav-link" data-module="book">
                    <i class="fas fa-book"></i>
                    图书管理
                    <i class="fas fa-chevron-down arrow"></i>
                </a>
                <div class="sub-menu">
                    <div class="sub-item">
                        <a href="#" class="sub-link" data-module="book">
                            <i class="fas fa-list"></i>
                            图书列表
                        </a>
                    </div>
                    <div class="sub-item">
                        <a href="#" class="sub-link" data-module="book-add">
                            <i class="fas fa-plus"></i>
                            添加图书
                        </a>
                    </div>
                </div>
            </div>
            
            <div class="nav-item">
                <a href="#" class="nav-link" data-module="borrow">
                    <i class="fas fa-exchange-alt"></i>
                    借阅管理
                    <i class="fas fa-chevron-down arrow"></i>
                </a>
                <div class="sub-menu">
                    <div class="sub-item">
                        <a href="#" class="sub-link" data-module="borrow">
                            <i class="fas fa-list"></i>
                            借阅列表
                        </a>
                    </div>
                    <div class="sub-item">
                        <a href="#" class="sub-link" data-module="borrow-add">
                            <i class="fas fa-plus"></i>
                            新增借阅
                        </a>
                    </div>
                </div>
            </div>
            
            <div class="nav-item">
                <a href="#" class="nav-link" data-module="user">
                    <i class="fas fa-users"></i>
                    用户管理
                    <i class="fas fa-chevron-down arrow"></i>
                </a>
                <div class="sub-menu">
                    <div class="sub-item">
                        <a href="#" class="sub-link" data-module="user">
                            <i class="fas fa-list"></i>
                            用户列表
                        </a>
                    </div>
                    <div class="sub-item">
                        <a href="#" class="sub-link" data-module="user-add">
                            <i class="fas fa-plus"></i>
                            添加用户
                        </a>
                    </div>
                </div>
            </div>
            
            <div class="nav-item">
                <a href="#" class="nav-link" data-module="category">
                    <i class="fas fa-th-large"></i>
                    分类管理
                </a>
            </div>
            
            <div class="nav-item">
                <a href="#" class="nav-link" data-module="publisher">
                    <i class="fas fa-building"></i>
                    出版社管理
                </a>
            </div>
            
            <div class="nav-item">
                <a href="#" class="nav-link" data-module="author">
                    <i class="fas fa-user-edit"></i>
                    作者管理
                </a>
            </div>
            
            <div class="nav-item">
                <a href="#" class="nav-link" data-module="statistics">
                    <i class="fas fa-chart-line"></i>
                    统计分析
                </a>
            </div>
            
            <div class="nav-item">
                <a href="#" class="nav-link" data-module="settings">
                    <i class="fas fa-cogs"></i>
                    系统设置
                </a>
            </div>
        </div>
    </div>

    <!-- 主内容区 -->
    <div class="main-content">
        <!-- 系统概览模块 -->
        <div id="dashboardModule" class="module-content fade-in">
            <div class="page-header">
                <h1 class="page-title">系统概览</h1>
                <p class="page-subtitle">欢迎使用图书管理系统，今天是 <span id="currentDate"></span></p>
            </div>
            
            <div class="stats-grid">
                <div class="stat-card book">
                    <div class="stat-icon">
                        <i class="fas fa-book"></i>
                    </div>
                    <div class="stat-number" id="totalBooks">0</div>
                    <div class="stat-label">总图书数量</div>
                </div>
                
                <div class="stat-card user">
                    <div class="stat-icon">
                        <i class="fas fa-users"></i>
                    </div>
                    <div class="stat-number" id="totalUsers">0</div>
                    <div class="stat-label">注册用户数</div>
                </div>
                
                <div class="stat-card borrow">
                    <div class="stat-icon">
                        <i class="fas fa-exchange-alt"></i>
                    </div>
                    <div class="stat-number" id="borrowedBooks">0</div>
                    <div class="stat-label">借阅中图书</div>
                </div>
                
                <div class="stat-card overdue">
                    <div class="stat-icon">
                        <i class="fas fa-exclamation-triangle"></i>
                    </div>
                    <div class="stat-number" id="overdueBooks">0</div>
                    <div class="stat-label">逾期图书</div>
                </div>
            </div>
            
            <div class="module-header">
                <h2 class="module-title">系统信息</h2>
                <p class="module-description">图书管理系统的运行状态和基本信息</p>
            </div>
            
            <div class="module-body">
                <div class="row">
                    <div class="col-md-6">
                        <h4>系统版本</h4>
                        <p>v2.2.0</p>
                    </div>
                    <div class="col-md-6">
                        <h4>最后更新</h4>
                        <p>2025-01-10</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- 图书管理模块 -->
        <div id="bookModule" class="module-content" style="display: none;">
            <div class="page-header">
                <h1 class="page-title">图书管理</h1>
                <p class="page-subtitle">管理图书信息，包括添加、编辑、删除图书</p>
            </div>
            
            <div class="search-form">
                <form class="layui-form" id="bookSearchForm">
                    <div class="form-row">
                        <div class="form-group">
                            <label>图书名称</label>
                            <input type="text" name="title" class="form-control" placeholder="请输入图书名称">
                        </div>
                        <div class="form-group">
                            <label>ISBN</label>
                            <input type="text" name="isbn" class="form-control" placeholder="请输入ISBN">
                        </div>
                        <div class="form-group">
                            <label>作者</label>
                            <select name="authorId" class="form-control">
                                <option value="">请选择作者</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group">
                            <label>分类</label>
                            <select name="categoryId" class="form-control">
                                <option value="">请选择分类</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label>出版社</label>
                            <select name="publisherId" class="form-control">
                                <option value="">请选择出版社</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label>状态</label>
                            <select name="status" class="form-control">
                                <option value="">全部</option>
                                <option value="1">在库</option>
                                <option value="0">借出</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-row">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-search"></i>
                            搜索
                        </button>
                        <button type="button" class="btn btn-secondary" id="bookReset">
                            <i class="fas fa-redo"></i>
                            重置
                        </button>
                    </div>
                </form>
            </div>
            
            <div class="module-header">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                    <div>
                        <h2 class="module-title">图书列表</h2>
                        <p class="module-description">显示所有图书信息，支持搜索和批量操作</p>
                    </div>
                    <div>
                        <button class="btn btn-warning" id="bookDeleteBatch">
                            <i class="fas fa-trash"></i>
                            批量删除
                        </button>
                        <button class="btn btn-success" id="bookExport">
                            <i class="fas fa-file-excel"></i>
                            导出Excel
                        </button>
                        <button class="btn btn-primary" id="bookAdd">
                            <i class="fas fa-plus"></i>
                            添加图书
                        </button>
                    </div>
                </div>
            </div>
            
            <div class="module-body">
                <table id="bookTable" lay-filter="bookTable"></table>
            </div>
        </div>

        <!-- 借阅管理模块 -->
        <div id="borrowModule" class="module-content" style="display: none;">
            <div class="page-header">
                <h1 class="page-title">借阅管理</h1>
                <p class="page-subtitle">管理图书借阅记录，包括借书、还书、续借等操作</p>
            </div>
            
            <div class="search-form">
                <form class="layui-form" id="borrowSearchForm">
                    <div class="form-row">
                        <div class="form-group">
                            <label>图书名称</label>
                            <input type="text" name="bookTitle" class="form-control" placeholder="请输入图书名称">
                        </div>
                        <div class="form-group">
                            <label>借阅人</label>
                            <input type="text" name="userName" class="form-control" placeholder="请输入借阅人姓名">
                        </div>
                        <div class="form-group">
                            <label>状态</label>
                            <select name="status" class="form-control">
                                <option value="">全部</option>
                                <option value="0">借阅中</option>
                                <option value="1">已归还</option>
                                <option value="2">逾期</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-row">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-search"></i>
                            搜索
                        </button>
                        <button type="button" class="btn btn-secondary" id="borrowReset">
                            <i class="fas fa-redo"></i>
                            重置
                        </button>
                    </div>
                </form>
            </div>
            
            <div class="module-header">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                    <div>
                        <h2 class="module-title">借阅列表</h2>
                        <p class="module-description">显示所有借阅记录，支持搜索和批量操作</p>
                    </div>
                    <div>
                        <button class="btn btn-warning" id="borrowDeleteBatch">
                            <i class="fas fa-trash"></i>
                            批量删除
                        </button>
                        <button class="btn btn-primary" id="borrowAdd">
                            <i class="fas fa-plus"></i>
                            新增借阅
                        </button>
                    </div>
                </div>
            </div>
            
            <div class="module-body">
                <table id="borrowTable" lay-filter="borrowTable"></table>
            </div>
        </div>

        <!-- 用户管理模块 -->
        <div id="userModule" class="module-content" style="display: none;">
            <div class="page-header">
                <h1 class="page-title">用户管理</h1>
                <p class="page-subtitle">管理系统用户，包括添加、编辑、删除用户信息</p>
            </div>
            
            <div class="search-form">
                <form class="layui-form" id="userSearchForm">
                    <div class="form-row">
                        <div class="form-group">
                            <label>用户名</label>
                            <input type="text" name="username" class="form-control" placeholder="请输入用户名">
                        </div>
                        <div class="form-group">
                            <label>姓名</label>
                            <input type="text" name="realName" class="form-control" placeholder="请输入姓名">
                        </div>
                        <div class="form-group">
                            <label>状态</label>
                            <select name="status" class="form-control">
                                <option value="">全部</option>
                                <option value="1">正常</option>
                                <option value="0">禁用</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-row">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-search"></i>
                            搜索
                        </button>
                        <button type="button" class="btn btn-secondary" id="userReset">
                            <i class="fas fa-redo"></i>
                            重置
                        </button>
                    </div>
                </form>
            </div>
            
            <div class="module-header">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                    <div>
                        <h2 class="module-title">用户列表</h2>
                        <p class="module-description">显示所有用户信息，支持搜索和批量操作</p>
                    </div>
                    <div>
                        <button class="btn btn-warning" id="userDeleteBatch">
                            <i class="fas fa-trash"></i>
                            批量删除
                        </button>
                        <button class="btn btn-primary" id="userAdd">
                            <i class="fas fa-plus"></i>
                            添加用户
                        </button>
                    </div>
                </div>
            </div>
            
            <div class="module-body">
                <table id="userTable" lay-filter="userTable"></table>
            </div>
        </div>

        <!-- 分类管理模块 -->
        <div id="categoryModule" class="module-content" style="display: none;">
            <div class="page-header">
                <h1 class="page-title">分类管理</h1>
                <p class="page-subtitle">管理图书分类，包括添加、编辑、删除分类</p>
            </div>
            
            <div class="search-form">
                <form class="layui-form" id="categorySearchForm">
                    <div class="form-row">
                        <div class="form-group">
                            <label>分类名称</label>
                            <input type="text" name="name" class="form-control" placeholder="请输入分类名称">
                        </div>
                        <div class="form-group">
                            <label>状态</label>
                            <select name="status" class="form-control">
                                <option value="">全部</option>
                                <option value="1">启用</option>
                                <option value="0">禁用</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-row">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-search"></i>
                            搜索
                        </button>
                        <button type="button" class="btn btn-secondary" id="categoryReset">
                            <i class="fas fa-redo"></i>
                            重置
                        </button>
                    </div>
                </form>
            </div>
            
            <div class="module-header">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                    <div>
                        <h2 class="module-title">分类列表</h2>
                        <p class="module-description">显示所有图书分类，支持搜索和批量操作</p>
                    </div>
                    <div>
                        <button class="btn btn-warning" id="categoryDeleteBatch">
                            <i class="fas fa-trash"></i>
                            批量删除
                        </button>
                        <button class="btn btn-primary" id="categoryAdd">
                            <i class="fas fa-plus"></i>
                            添加分类
                        </button>
                    </div>
                </div>
            </div>
            
            <div class="module-body">
                <table id="categoryTable" lay-filter="categoryTable"></table>
            </div>
        </div>

        <!-- 出版社管理模块 -->
        <div id="publisherModule" class="module-content" style="display: none;">
            <div class="page-header">
                <h1 class="page-title">出版社管理</h1>
                <p class="page-subtitle">管理出版社信息，包括添加、编辑、删除出版社</p>
            </div>
            
            <div class="search-form">
                <form class="layui-form" id="publisherSearchForm">
                    <div class="form-row">
                        <div class="form-group">
                            <label>出版社名称</label>
                            <input type="text" name="name" class="form-control" placeholder="请输入出版社名称">
                        </div>
                        <div class="form-group">
                            <label>状态</label>
                            <select name="status" class="form-control">
                                <option value="">全部</option>
                                <option value="1">启用</option>
                                <option value="0">禁用</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-row">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-search"></i>
                            搜索
                        </button>
                        <button type="button" class="btn btn-secondary" id="publisherReset">
                            <i class="fas fa-redo"></i>
                            重置
                        </button>
                    </div>
                </form>
            </div>
            
            <div class="module-header">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                    <div>
                        <h2 class="module-title">出版社列表</h2>
                        <p class="module-description">显示所有出版社信息，支持搜索和批量操作</p>
                    </div>
                    <div>
                        <button class="btn btn-warning" id="publisherDeleteBatch">
                            <i class="fas fa-trash"></i>
                            批量删除
                        </button>
                        <button class="btn btn-primary" id="publisherAdd">
                            <i class="fas fa-plus"></i>
                            添加出版社
                        </button>
                    </div>
                </div>
            </div>
            
            <div class="module-body">
                <table id="publisherTable" lay-filter="publisherTable"></table>
            </div>
        </div>

        <!-- 作者管理模块 -->
        <div id="authorModule" class="module-content" style="display: none;">
            <div class="page-header">
                <h1 class="page-title">作者管理</h1>
                <p class="page-subtitle">管理作者信息，包括添加、编辑、删除作者</p>
            </div>
            
            <div class="search-form">
                <form class="layui-form" id="authorSearchForm">
                    <div class="form-row">
                        <div class="form-group">
                            <label>作者姓名</label>
                            <input type="text" name="name" class="form-control" placeholder="请输入作者姓名">
                        </div>
                        <div class="form-group">
                            <label>状态</label>
                            <select name="status" class="form-control">
                                <option value="">全部</option>
                                <option value="1">启用</option>
                                <option value="0">禁用</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-row">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-search"></i>
                            搜索
                        </button>
                        <button type="button" class="btn btn-secondary" id="authorReset">
                            <i class="fas fa-redo"></i>
                            重置
                        </button>
                    </div>
                </form>
            </div>
            
            <div class="module-header">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                    <div>
                        <h2 class="module-title">作者列表</h2>
                        <p class="module-description">显示所有作者信息，支持搜索和批量操作</p>
                    </div>
                    <div>
                        <button class="btn btn-warning" id="authorDeleteBatch">
                            <i class="fas fa-trash"></i>
                            批量删除
                        </button>
                        <button class="btn btn-primary" id="authorAdd">
                            <i class="fas fa-plus"></i>
                            添加作者
                        </button>
                    </div>
                </div>
            </div>
            
            <div class="module-body">
                <table id="authorTable" lay-filter="authorTable"></table>
            </div>
        </div>

        <!-- 页脚 -->
        <div class="footer">
            © 2025 图书管理系统 - heefM版权所有
        </div>
    </div>

    <!-- 表格工具栏模板 -->
    <script type="text/html" id="bookToolbar">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchDel">批量删除</button>
        </div>
    </script>

    <script type="text/html" id="bookBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>

    <script type="text/html" id="borrowToolbar">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchDel">批量删除</button>
        </div>
    </script>

    <script type="text/html" id="borrowBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>

    <script type="text/html" id="userToolbar">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchDel">批量删除</button>
        </div>
    </script>

    <script type="text/html" id="userBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>

    <script type="text/html" id="categoryToolbar">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchDel">批量删除</button>
        </div>
    </script>

    <script type="text/html" id="categoryBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>

    <script type="text/html" id="publisherToolbar">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchDel">批量删除</button>
        </div>
    </script>

    <script type="text/html" id="publisherBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>

    <script type="text/html" id="authorToolbar">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchDel">批量删除</button>
        </div>
    </script>

    <script type="text/html" id="authorBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>

    <!-- JavaScript -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="layui/layui.js"></script>
    <script src="js/dashboard-init.js"></script>
    <script src="js/main.js"></script>
    <script src="js/book.js"></script>
    <script src="js/borrow.js"></script>
    <script src="js/user.js"></script>
    <script src="js/category.js"></script>
    <script src="js/publisher.js"></script>
    <script src="js/author.js"></script>
    <script>
        // 初始化Layui模块
        layui.use(['main', 'book', 'borrow', 'user', 'category', 'publisher', 'author'], function() {
            var main = layui.main;
            if (main && main.init) {
                main.init();
            }
        });

        // 侧边栏导航交互
        $(document).ready(function() {
            // 导航菜单展开/收起
            $('.nav-link').on('click', function(e) {
                e.preventDefault();
                
                var $this = $(this);
                var $subMenu = $this.siblings('.sub-menu');
                
                // 如果有点击箭头，说明有子菜单
                if ($this.find('.arrow').length > 0) {
                    $this.toggleClass('expanded');
                    $subMenu.toggleClass('expanded');
                    return; // 如果有子菜单，不处理模块切换
                }
                
                // 处理模块切换
                var module = $this.data('module');
                if (module) {
                    loadModule(module);
                    
                    // 更新导航状态
                    $('.nav-link').removeClass('active');
                    $('.sub-link').removeClass('active');
                    $this.addClass('active');
                }
            });
            
            // 子菜单项点击
            $('.sub-link').on('click', function(e) {
                e.preventDefault();
                
                var $this = $(this);
                var module = $this.data('module');
                
                if (module) {
                    loadModule(module);
                    
                    // 更新导航状态
                    $('.nav-link').removeClass('active');
                    $('.sub-link').removeClass('active');
                    $this.addClass('active');
                }
            });
        });
    </script>
</body>
</html> 